<?php
/*
#####################################
#  ShopOS: Shopping Cart Software.
#  
#  
#  http://shopos3.com
#  Ver. 1.0.0
#####################################
*/

function os_show_category($counter) 
{
    global $foo, $categories_string, $id;
    
    $categories_string .= '<li class="CatLevel'.$foo[$counter]['level'].'';

    if ( ($id) && (in_array($counter, $id)) ) {
      $categories_string .=  ' Current">';
    } else {
      $categories_string .=  '">';
    }

      $categories_string .=  '<a href="';

        
	$cPath_new=os_category_link($counter,$foo[$counter]['name']);
  
    $categories_string .= os_href_link(FILENAME_DEFAULT, $cPath_new);
    $categories_string .= '">';

    // display category name
    $categories_string .= $foo[$counter]['name'];

    if (SHOW_COUNTS == 'true') {
      $products_in_category = os_count_products_in_category($counter);
      if ($products_in_category > 0) {
        $categories_string .= '&nbsp;(' . $products_in_category . ')';
      }
    }

    $categories_string .= '</a></li>';

    if ($foo[$counter]['next_id']) {
        os_show_category($foo[$counter]['next_id']);
    } else {
        $categories_string .= '';
    }

  }

?>